package com.forum.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 文章信息
 * @TableName forum_article
 */
@TableName(value ="forum_article")
public class ForumArticle implements Serializable {
    /**
     * 文章ID
     */
    @TableId
    private String articleId;

    /**
     * 父级板块ID
     */
    private Integer pBoardId;

    /**
     * 父板块名称
     */
    private String pBoardName;

    /**
     * 发帖者ID
     */
    private Long userId;

    /**
     * 昵称
     */
    private String nickName;

    /**
     * 标题
     */
    private String title;

    /**
     * 话题 相关
     */
    private String tag;

    /**
     * 内容
     */
    private String content;

    /**
     * 摘要
     */
    private String summary;

    /**
     * 发布时间
     */
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date postTime;

    /**
     * 最后更新时间
     */
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date lastUpdateTime;

    /**
     * 阅读数量
     */
    private Integer readCount;

    /**
     * 点赞数
     */
    private Integer goodCount;

    /**
     * 评论数
     */
    private Integer commentCount;

    /**
     * 0未置顶  1:已置顶
     */
    private Integer topType;

    /**
     * -1已删除 0:待审核  1:已审核 
     */
    private Integer status;

    /**
     * 0:没有附件  1:有附件
     */
    private Integer attachmentType;

    /**
     * 0:不加精，1：加
     */
    private Integer star;

    /**
     * 0:不是1：是
     */
    private Integer questionType;

    /**
     * 答案
     */
    private String answer;

    /**
     * 如果有问题，问题答案发布时间
     */
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    private Date deadline;

    /**
     * 逻辑删除
     */
    @TableLogic
    @TableField(select = false)
    private Integer deleteFlag;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 文章ID
     */
    public String getArticleId() {
        return articleId;
    }

    /**
     * 文章ID
     */
    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    /**
     * 父级板块ID
     */
    public Integer getpBoardId() {
        return pBoardId;
    }

    /**
     * 父级板块ID
     */
    public void setpBoardId(Integer pBoardId) {
        this.pBoardId = pBoardId;
    }

    /**
     * 父板块名称
     */
    public String getpBoardName() {
        return pBoardName;
    }

    /**
     * 父板块名称
     */
    public void setpBoardName(String pBoardName) {
        this.pBoardName = pBoardName;
    }

    /**
     * 发帖者ID
     */
    public Long getUserId() {
        return userId;
    }

    /**
     * 发帖者ID
     */
    public void setUserId(Long userId) {
        this.userId = userId;
    }

    /**
     * 昵称
     */
    public String getNickName() {
        return nickName;
    }

    /**
     * 昵称
     */
    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    /**
     * 标题
     */
    public String getTitle() {
        return title;
    }

    /**
     * 标题
     */
    public void setTitle(String title) {
        this.title = title;
    }

    /**
     * 话题 相关
     */
    public String getTag() {
        return tag;
    }

    /**
     * 话题 相关
     */
    public void setTag(String tag) {
        this.tag = tag;
    }

    /**
     * 内容
     */
    public String getContent() {
        return content;
    }

    /**
     * 内容
     */
    public void setContent(String content) {
        this.content = content;
    }

    /**
     * 摘要
     */
    public String getSummary() {
        return summary;
    }

    /**
     * 摘要
     */
    public void setSummary(String summary) {
        this.summary = summary;
    }

    /**
     * 发布时间
     */
    @JsonFormat(
            pattern = "yyyy-MM-dd HH:mm:ss",
            timezone = "GMT+8"
    )
    public Date getPostTime() {
        return postTime;
    }

    /**
     * 发布时间
     */
    public void setPostTime(Date postTime) {
        this.postTime = postTime;
    }

    /**
     * 最后更新时间
     */
    public Date getLastUpdateTime() {
        return lastUpdateTime;
    }

    /**
     * 最后更新时间
     */
    public void setLastUpdateTime(Date lastUpdateTime) {
        this.lastUpdateTime = lastUpdateTime;
    }

    /**
     * 阅读数量
     */
    public Integer getReadCount() {
        return readCount;
    }

    /**
     * 阅读数量
     */
    public void setReadCount(Integer readCount) {
        this.readCount = readCount;
    }

    /**
     * 点赞数
     */
    public Integer getGoodCount() {
        return goodCount;
    }

    /**
     * 点赞数
     */
    public void setGoodCount(Integer goodCount) {
        this.goodCount = goodCount;
    }

    /**
     * 评论数
     */
    public Integer getCommentCount() {
        return commentCount;
    }

    /**
     * 评论数
     */
    public void setCommentCount(Integer commentCount) {
        this.commentCount = commentCount;
    }

    /**
     * 0未置顶  1:已置顶
     */
    public Integer getTopType() {
        return topType;
    }

    /**
     * 0未置顶  1:已置顶
     */
    public void setTopType(Integer topType) {
        this.topType = topType;
    }

    /**
     * -1已删除 0:待审核  1:已审核 
     */
    public Integer getStatus() {
        return status;
    }

    /**
     * -1已删除 0:待审核  1:已审核 
     */
    public void setStatus(Integer status) {
        this.status = status;
    }

    /**
     * 0:没有附件  1:有附件
     */
    public Integer getAttachmentType() {
        return attachmentType;
    }

    /**
     * 0:没有附件  1:有附件
     */
    public void setAttachmentType(Integer attachmentType) {
        this.attachmentType = attachmentType;
    }

    /**
     * 0:不加精，1：加
     */
    public Integer getStar() {
        return star;
    }

    /**
     * 0:不加精，1：加
     */
    public void setStar(Integer star) {
        this.star = star;
    }

    /**
     * 0:不是1：是
     */
    public Integer getQuestionType() {
        return questionType;
    }

    /**
     * 0:不是1：是
     */
    public void setQuestionType(Integer questionType) {
        this.questionType = questionType;
    }

    /**
     * 答案
     */
    public String getAnswer() {
        return answer;
    }

    /**
     * 答案
     */
    public void setAnswer(String answer) {
        this.answer = answer;
    }

    /**
     * 如果有问题，问题答案发布时间
     */
    public Date getDeadline() {
        return deadline;
    }

    /**
     * 如果有问题，问题答案发布时间
     */
    public void setDeadline(Date deadline) {
        this.deadline = deadline;
    }

    /**
     * 逻辑删除
     */
    public Integer getDeleteFlag() {
        return deleteFlag;
    }

    /**
     * 逻辑删除
     */
    public void setDeleteFlag(Integer deleteFlag) {
        this.deleteFlag = deleteFlag;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        ForumArticle other = (ForumArticle) that;
        return (this.getArticleId() == null ? other.getArticleId() == null : this.getArticleId().equals(other.getArticleId()))
            && (this.getpBoardId() == null ? other.getpBoardId() == null : this.getpBoardId().equals(other.getpBoardId()))
            && (this.getpBoardName() == null ? other.getpBoardName() == null : this.getpBoardName().equals(other.getpBoardName()))
            && (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getNickName() == null ? other.getNickName() == null : this.getNickName().equals(other.getNickName()))
            && (this.getTitle() == null ? other.getTitle() == null : this.getTitle().equals(other.getTitle()))
            && (this.getTag() == null ? other.getTag() == null : this.getTag().equals(other.getTag()))
            && (this.getContent() == null ? other.getContent() == null : this.getContent().equals(other.getContent()))
            && (this.getSummary() == null ? other.getSummary() == null : this.getSummary().equals(other.getSummary()))
            && (this.getPostTime() == null ? other.getPostTime() == null : this.getPostTime().equals(other.getPostTime()))
            && (this.getLastUpdateTime() == null ? other.getLastUpdateTime() == null : this.getLastUpdateTime().equals(other.getLastUpdateTime()))
            && (this.getReadCount() == null ? other.getReadCount() == null : this.getReadCount().equals(other.getReadCount()))
            && (this.getGoodCount() == null ? other.getGoodCount() == null : this.getGoodCount().equals(other.getGoodCount()))
            && (this.getCommentCount() == null ? other.getCommentCount() == null : this.getCommentCount().equals(other.getCommentCount()))
            && (this.getTopType() == null ? other.getTopType() == null : this.getTopType().equals(other.getTopType()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getAttachmentType() == null ? other.getAttachmentType() == null : this.getAttachmentType().equals(other.getAttachmentType()))
            && (this.getStar() == null ? other.getStar() == null : this.getStar().equals(other.getStar()))
            && (this.getQuestionType() == null ? other.getQuestionType() == null : this.getQuestionType().equals(other.getQuestionType()))
            && (this.getAnswer() == null ? other.getAnswer() == null : this.getAnswer().equals(other.getAnswer()))
            && (this.getDeadline() == null ? other.getDeadline() == null : this.getDeadline().equals(other.getDeadline()))
            && (this.getDeleteFlag() == null ? other.getDeleteFlag() == null : this.getDeleteFlag().equals(other.getDeleteFlag()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getArticleId() == null) ? 0 : getArticleId().hashCode());
        result = prime * result + ((getpBoardId() == null) ? 0 : getpBoardId().hashCode());
        result = prime * result + ((getpBoardName() == null) ? 0 : getpBoardName().hashCode());
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getNickName() == null) ? 0 : getNickName().hashCode());
        result = prime * result + ((getTitle() == null) ? 0 : getTitle().hashCode());
        result = prime * result + ((getTag() == null) ? 0 : getTag().hashCode());
        result = prime * result + ((getContent() == null) ? 0 : getContent().hashCode());
        result = prime * result + ((getSummary() == null) ? 0 : getSummary().hashCode());
        result = prime * result + ((getPostTime() == null) ? 0 : getPostTime().hashCode());
        result = prime * result + ((getLastUpdateTime() == null) ? 0 : getLastUpdateTime().hashCode());
        result = prime * result + ((getReadCount() == null) ? 0 : getReadCount().hashCode());
        result = prime * result + ((getGoodCount() == null) ? 0 : getGoodCount().hashCode());
        result = prime * result + ((getCommentCount() == null) ? 0 : getCommentCount().hashCode());
        result = prime * result + ((getTopType() == null) ? 0 : getTopType().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getAttachmentType() == null) ? 0 : getAttachmentType().hashCode());
        result = prime * result + ((getStar() == null) ? 0 : getStar().hashCode());
        result = prime * result + ((getQuestionType() == null) ? 0 : getQuestionType().hashCode());
        result = prime * result + ((getAnswer() == null) ? 0 : getAnswer().hashCode());
        result = prime * result + ((getDeadline() == null) ? 0 : getDeadline().hashCode());
        result = prime * result + ((getDeleteFlag() == null) ? 0 : getDeleteFlag().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", articleId=").append(articleId);
        sb.append(", pBoardId=").append(pBoardId);
        sb.append(", pBoardName=").append(pBoardName);
        sb.append(", userId=").append(userId);
        sb.append(", nickName=").append(nickName);
        sb.append(", title=").append(title);
        sb.append(", tag=").append(tag);
        sb.append(", content=").append(content);
        sb.append(", summary=").append(summary);
        sb.append(", postTime=").append(postTime);
        sb.append(", lastUpdateTime=").append(lastUpdateTime);
        sb.append(", readCount=").append(readCount);
        sb.append(", goodCount=").append(goodCount);
        sb.append(", commentCount=").append(commentCount);
        sb.append(", topType=").append(topType);
        sb.append(", status=").append(status);
        sb.append(", attachmentType=").append(attachmentType);
        sb.append(", star=").append(star);
        sb.append(", questionType=").append(questionType);
        sb.append(", answer=").append(answer);
        sb.append(", deadline=").append(deadline);
        sb.append(", deleteFlag=").append(deleteFlag);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}